import {
  PhotoFilter as PhotoFilterIcon,
  SwitchAccessShortcut as SwitchAccessShortcutIcon,
  AutoGraph as AutoGraphIcon,
  LocalActivityOutlined as LocalActivityOutlinedIcon,
  TipsAndUpdatesOutlined as TipsAndUpdatesOutlinedIcon,
  AssistantOutlined as AssistantOutlinedIcon
} from '@mui/icons-material'
import { LiftStatusEnum, ServiceTypeEnum, ShiftStatusEnum, AdvisorTypeEnum, SalaryStatusEnum } from '@/types/enum'
import { deepPurple, green, orange, deepOrange, blue, red, teal, grey, cyan, blueGrey } from '@mui/material/colors'
import {
  IconPlus,
  IconEdit,
  IconTrash,
  IconCircleHalf2,
  IconCircleDot,
  IconCircleCheck,
  IconCircleDashed,
  IconBan,
  IconArrowNarrowUp,
  IconArrowNarrowDown,
  IconArrowNarrowRight,
  IconPlaneTilt,
  IconAlertTriangleFilled,
  IconAlertCircleFilled,
  IconSquareCheckFilled
} from '@tabler/icons-react'
import { Color } from '@mui/material'
import { ButtonType } from '@/types/common'
// theme constant
export const gridSpacing = 3
export const drawerWidth = 260
export const appDrawerWidth = 320

// 登录页面
export const LoginUrl = 'https://login.light-do.com/'

// 颜色序列
export const ColorList = [blue, deepOrange, green, deepPurple, cyan, orange, teal, red]

// icon序列
export const IconList = [
  PhotoFilterIcon,
  SwitchAccessShortcutIcon,
  LocalActivityOutlinedIcon,
  AutoGraphIcon,
  TipsAndUpdatesOutlinedIcon,
  AssistantOutlinedIcon
]

export const ButtonConfig: ButtonType = {
  add: {
    label: '新增',
    icon: IconPlus
  },
  edit: {
    label: '编辑',
    icon: IconEdit
  },
  delete: {
    label: '删除',
    icon: IconTrash
  }
}

export const PaletteColor = {
  primary: 'primary',
  secondary: 'secondary',
  success: 'success',
  error: 'error',
  warning: 'warning',
  info: 'info'
}

export const ShiftStatus = [
  { label: '全勤', status: ShiftStatusEnum.normal, icon: IconCircleCheck, color: green },
  { label: '请假', status: ShiftStatusEnum.rest, icon: IconCircleDashed, color: blueGrey },
  { label: '休假', status: ShiftStatusEnum.holiday, icon: IconPlaneTilt, color: grey },
  { label: '迟到/早退', status: ShiftStatusEnum.late_or_leave_early, icon: IconCircleDot, color: blue },
  { label: '旷工1天', status: ShiftStatusEnum.absence, icon: IconBan, color: red },
  { label: '旷工0.5天', status: ShiftStatusEnum.absence_half_day, icon: IconCircleHalf2, color: deepOrange }
]

export const DefaultPagination = {
  pageSize: 20,
  page: 0
}
export const PageSizes = [20]

export const LiftStatusList: {
  color: Color
  label: string
  value: number
  icon: React.ComponentType<any>
}[] = [
  { color: red, label: '预降级', value: LiftStatusEnum.Down, icon: IconArrowNarrowDown },
  { color: green, label: '预升级', value: LiftStatusEnum.Up, icon: IconArrowNarrowUp },
  { color: grey, label: '正常', value: LiftStatusEnum.Normal, icon: IconArrowNarrowRight }
]

export const ServiceList = [
  { label: 'Audio', type: ServiceTypeEnum.Audio },
  { label: 'Video', type: ServiceTypeEnum.Video },
  { label: 'Text Call', type: ServiceTypeEnum.TextCall },
  { label: 'Audio Call', type: ServiceTypeEnum.AudioCall },
  { label: 'Video Call', type: ServiceTypeEnum.VideoCall }
]

export const DefaultAvatar =
  'https://api.dicebear.com/7.x/adventurer/svg?backgroundColor=ffffff&skinColor=f2d3b1&scale=100&glassesProbability=100&translateY=5&hair=short01&hairColor=e16162&mouth=variant01&glasses=variant01'

export const AdvisorStage = [
  { label: '培训预开始', value: 0 },
  { label: '培训期', value: 1 },
  { label: '考核期', value: 2 },
  { label: '正式顾问', value: 3 }
]

// 实时服务类型
export const NonRealtimeService = [ServiceTypeEnum.Text, ServiceTypeEnum.Audio, ServiceTypeEnum.Video]
// 非实时服务类型
export const RealtimeService = [ServiceTypeEnum.TextCall, ServiceTypeEnum.AudioCall, ServiceTypeEnum.VideoCall]

export const AdvisorTypeMap = {
  [AdvisorTypeEnum.Normal]: '普通',
  [AdvisorTypeEnum.India]: '印度'
}

export const CalendarOption = {
  sameDay: 'HH:mm', // The same day ( Today at 2:30 AM )
  lastDay: '[Yesterday]', // The day before ( Yesterday at 2:30 AM )
  lastWeek: '[Last] dddd', // Last week ( Last Monday at 2:30 AM )
  sameElse: 'YYYY-MM-DD HH:mm' // Everything else ( 7/10/2011 )
}

export const SalaryStatusMap = {
  [SalaryStatusEnum.Default]: { label: '待确认', color: 'error', icon: IconAlertTriangleFilled },
  [SalaryStatusEnum.Confirmed]: { label: '待发放', color: 'primary', icon: IconAlertCircleFilled },
  [SalaryStatusEnum.Issued]: { label: '已发放', color: 'success', icon: IconSquareCheckFilled }
}

export const SalaryFieldsMap = {
  basic_salary: '底薪',
  achievement_bonus: '业绩',
  performance_reward: '绩效',
  refund_risk_deposit: '退押金',
  released_deposit: '扣押金'
}
